package znbkBkfx.BKFX_GCT;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.znbk.znbklibrary.base.BaseRecyclerAdapter;
import com.example.znbk.znbklibrary.base.BaseRecyclerViewHolder;
import com.lancoo.znbkxx.R;

import java.util.List;

import znbkBkfx.GetBkfxJson.BkfxPaperEntity;

public class BkfxGctAnswerAdapter extends BaseRecyclerAdapter {

    private Context context;
    private BkfxPaperEntity bkfxPaperEntity;
    private int childIndex = -1;
    private CallBackAdapterGct callBackAdapterGct;
    private LayoutInflater inflater;

    public BkfxGctAnswerAdapter(Context context, BkfxPaperEntity bkfxPaperEntity, int childIndex, CallBackAdapterGct callBackAdapterGct){
        this. context=context;
        this.bkfxPaperEntity = bkfxPaperEntity;
        this.childIndex = childIndex;
        this.callBackAdapterGct = callBackAdapterGct;
        inflater=LayoutInflater. from(context);
    }

    @Override
    public View getHolderView(ViewGroup parent, int position) {
        View view = inflater.inflate(R.layout.bkfx_adapter_item_answer_gct,parent, false);
        return view;
    }

    private TextView mTvQuesBody;
    @Override
    public void onBindViewHolder(BaseRecyclerViewHolder baseRecyclerViewHolder, int position) {

        mTvQuesBody = baseRecyclerViewHolder.getView(R.id.tv_quesBody);
        String QuesBody = bkfxPaperEntity.getQuesList().get(childIndex).getQuesBody();
        mTvQuesBody.setText(QuesBody);

    }

    @Override
    public int getItemCount() {
        return 1;
    }

    public interface CallBackAdapterGct {
        void callHideRecordMiView();
        void callShowMaskDialog(List<Boolean> answerResult);
    }

}
